from django.db import models


class Student(models.Model):
    # 每个属性对应数据库的一列
    name = models.CharField(max_length=100, verbose_name="姓名")
    student_id = models.CharField(max_length=10, unique=True, verbose_name="学号")
    age = models.IntegerField(verbose_name="年龄")
    created_time = models.DateTimeField(auto_now_add=True, verbose_name="创建时间")

    def __str__(self):
        return f"{self.name} ({self.student_id})"